package com.joysuch.wwyt.workflow.entity;

import cn.zlg.common.springmvc.validate.constraints.NotNull;
import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import java.time.LocalDateTime;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * @Author ZhangDong
 * @Date 2020/12/16 11:44
 */
@Data
@Entity
@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Table(name = "wwyt_workflow_rail_alarm_config")
@SQLDelete(sql = "update wwyt_workflow_rail_alarm_config set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_workflow_rail_alarm_config set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
public class WorkFlowRailAlarmConfig {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @ApiModelProperty("主键ID")
    private Long id;
    @ApiModelProperty("流程节点ID")
    private Long processId;
    @ApiModelProperty("生效时间")
    private String effectiveTime;
    @ApiModelProperty("开始节点")
    private String startNode;
    @ApiModelProperty("结束节点")
    private String endNode;
    @ApiModelProperty("开始时间")
    private String startTimeKey;
    @ApiModelProperty("结束时间")
    private String endTimeKey;
    @ApiModelProperty("报警规则")
    private String alarmRule;
    @ApiModelProperty("允许进入")
    private boolean permitEnter;
    @ApiModelProperty("离岗报警")
    private boolean leaveAlarm;

    //通用字段
    @org.springframework.data.annotation.CreatedBy
    @ApiModelProperty("创建人")
    private Long createBy;
    @org.springframework.data.annotation.CreatedDate
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;
    @org.springframework.data.annotation.LastModifiedBy
    @ApiModelProperty("更新人")
    private Long updateBy;
    @org.springframework.data.annotation.LastModifiedDate
    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;
    @ApiModelProperty("租户")
    private Long tenentId;
    @ApiModelProperty("组织机构代码")
    private String orgCode;
    @ApiModelProperty("删除标记")
    private String deleteFlag;

}
